﻿/* 
 PureMVC C# Port by Andy Adamczak <andy.adamczak@puremvc.org>, et al.
 PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. 
 Your reuse is governed by the Creative Commons Attribution 3.0 License 
*/

#region Using

using System;

using PureMVC.Interfaces;

#endregion

namespace PureMVC.Patterns
{
    /// <summary>
    /// Notification通知
    /// </summary>
    public class Notification : INotification
    {
        private string m_name;
        private string m_type;
        private object m_body;
        public Notification(string name, object body, string type)
        {
            m_name = name;
            m_body = body;
            m_type = type;
        }
        public Notification(string name) : this(name, null, null)
        {
        }
        public Notification(string name, object body) : this(name, body, null)
        {
        }
       

        public override string ToString()
        {
            string msg = "Notification Name: " + Name;
            msg += "\nBody:" + ((Body == null) ? "null" : Body.ToString());
            msg += "\nType:" + ((Type == null) ? "null" : Type);
            return msg;
        }
        public virtual string Name
        {
            get { return m_name; }
        }
        public virtual object Body
        {
            get
            {
                return m_body;
            }
            set
            {
                m_body = value;
            }
        }
        public virtual string Type
        {
            get
            {
                return m_type;
            }
            set
            {
                m_type = value;
            }
        }
    }
}
